import request from '@/utils/request'
export default {
  //添加
  add (data) {
    return request({
      url: '/firmwareService/deviceTypeFunc/add',
      method: 'POST',
      data
    })
  },
  //修改
  edit (data) {
    return request({
      url: '/firmwareService/deviceTypeFunc/edit',
      method: 'POST',
      data
    })
  },
  //列表查询
  queryList (params) {
    return request({
      url: '/firmwareService/deviceTypeFunc/queryList',
      method: 'get',
      params
    })
  },
  //分页查询
  queryPageList (params) {
    return request({
      url: '/firmwareService/deviceTypeFunc/queryPageList',
      method: 'get',
      params
    })
  },
  //主键删除接口
  del (id) {
    return request({
      url: '/firmwareService/deviceTypeFunc/del',
      method: 'post',
      data: {
        deviceTypeFuncId: id
      }
    })
  },
  //主键批量删除接口
  delList (idList) {
    return request({
      url: '/firmwareService/deviceTypeFunc/delList',
      method: 'post',
      data: {
        deviceTypeFuncidList: idList
      }
    })
  },
  // 通过设备类型ID查询登录用户可使用功能及文件列表
  queryLoginUserFuncAndFilesList (id) {
    return request({
      url: `/firmwareService/user/queryLoginUserFuncAndFilesList?deviceTypeId=${id}`,
      method: 'get'
    })
  },
  //根据用户ID查询已有类型功能列表
  queryTypeFuncListByUserId (id) {
    return request({
      url: `/firmwareService/user/queryTypeFuncListByUserId?userId=${id}`,
      method: 'get'
    })
  },
  //查询所有设备类型及功能列表
  queryListAndFunc () {
    return request({
      url: `/firmwareService/deviceType/queryListAndFunc`,
      method: 'get'
    })
  }
}